﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListOutStorageRecord.aspx.cs"
    Inherits="dzs.Web.Outstorage.ListOutStorageRecord" EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/JsTools.js" type="text/javascript"></script>
    <style type="text/css">
        td
        {
            font-size: 9pt;
        }
        a
        {
            color: Blue;
            text-decoration: none;
        }
        body
        {
            font-size: 9pt;
        }
    </style>
    <link href="../Style.css" rel="stylesheet" />
    <link href="../css/myStyle.css" rel="stylesheet" />
    <link href="/style.css" type="text/css" rel="stylesheet" />
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#txt_projectname").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });

         function showQRC(id) {

             window.open('../PrintQCR.aspx?id=' + id + "&type=out", 'newwindow', 'height=600, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
         }
         </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div style="text-align: left; margin-bottom: 10px; margin-top: 10px;">
            <b>出库记录 </b>
        </div>
        <div style="text-align: left; margin-bottom: 10px; margin-top: 10px;">
            项目编号：
            <asp:TextBox ID="txt_proid" runat="server"></asp:TextBox>&nbsp; 项目名称：<asp:TextBox
                ID="txt_projectname" runat="server"></asp:TextBox>&nbsp; 物料名称：<asp:TextBox ID="txt_material"
                    runat="server"></asp:TextBox>
            &nbsp;</div>
        <div>
            到货地点：
            <asp:TextBox ID="txt_receive_address" runat="server"></asp:TextBox>&nbsp; 目的项目：<asp:TextBox
                ID="txt_targetProjectName" runat="server"></asp:TextBox>&nbsp;
            <asp:Button ID="btn_sel" runat="server" Text="查询" OnClick="btn_sel_Click" Width="80px" />
        </div>
        <div>
            <%--当前共有<asp:Label ID="lbl_count" runat="server" Text=""></asp:Label>条记录--%>
        </div>
        <div style="text-align: center">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateCopxlumns="False"
                OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="20" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"
                Width="2200px" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                          <a href="javascript:showQRC(<%# Eval("out_storage_id") %>)" style=" color:Blue">生成二维码 </a>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="spname" HeaderText="仓位名称" />
                    <asp:BoundField DataField="spadd" HeaderText="仓位地址" />
                    <asp:BoundField DataField="sname" HeaderText="仓库名称" />
                    <asp:BoundField DataField="material" HeaderText="物料描述" />
                    <asp:BoundField DataField="out_storage_count" HeaderText="出库数量" />
                    <asp:BoundField DataField="unitprice" DataFormatString="{0:N2}" 
                        HeaderText="单价" />
                    <asp:BoundField DataField="unit" HeaderText="数量单位" />
                    <asp:BoundField DataField="usework" HeaderText="需用单位" />
                    <asp:BoundField DataField="projectname" HeaderText="项目名称" />
                    <asp:BoundField DataField="proid" HeaderText="项目编号" />
                    <asp:BoundField DataField="out_storage_Time" HeaderText="出库时间" />
                    <asp:BoundField DataField="user_name" HeaderText="出库人员" />
                    <asp:BoundField DataField="receive_userName" HeaderText="接收人" />
                    <asp:BoundField DataField="receive_address" HeaderText="到货地点" />
                    <asp:BoundField DataField="targetProjectName" HeaderText="目的项目" />
                </Columns>
                <PagerStyle CssClass="mypager" />
            </asp:GridView>
        </div>
        <div style=" margin-top:5px; margin-bottom:5px;">
            共有<asp:Label ID="lbl_count" runat="server"></asp:Label>条记录，单价总计：
         
            <asp:Label ID="lbl_price" runat="server" ></asp:Label>
        &nbsp;元</div>
        <div>
            <asp:Button ID="btn_out" runat="server" Text="导出Excel" OnClick="btn_out_Click" />
        </div>
    </div>
    </form>
</body>
</html>
